1 00:00:00,720 --> 00:00:01,440 Alrighty. 2 00:00:01,440 --> 00:00:02,340 Welcome. 3 00:00:02,340 --> 00:00:07,230 This lecture is where we are going to set up everything we need to start scripting our game. 4 00:00:07,740 --> 00:00:12,450 You may see me building the map in the background of this lecture, and I'm going to lay the foundation 5 00:00:12,450 --> 00:00:14,520 for what we're going to need in our map. 6 00:00:14,550 --> 00:00:18,180 First we're going to need to spawn areas for our players. 7 00:00:18,210 --> 00:00:23,310 The first spawn area is going to hold all of our dead players while they are in the main guy. 8 00:00:23,340 --> 00:00:26,100 The second spawn area is going to be on our map. 9 00:00:26,340 --> 00:00:31,830 Our map should have four areas that zombies can spawn at, so it's not possible for the players to camp 10 00:00:31,830 --> 00:00:34,410 one particular zombie spawning area. 11 00:00:34,590 --> 00:00:39,090 Our map should also include a shop where players can purchase gear at the end of each wave. 12 00:00:39,120 --> 00:00:44,250 Lastly, our map should be impossible to escape, meaning we should have invisible walls to prevent 13 00:00:44,250 --> 00:00:47,400 players or zombies from wandering outside of the map. 14 00:00:47,700 --> 00:00:52,770 All of the assets you will need for this project, including the map, has been attached to this lecture. 15 00:00:52,770 --> 00:00:56,880 However, feel free to manipulate the map or even create your own from scratch. 16 00:00:57,710 --> 00:00:59,480 So let's go ahead and get started. 17 00:00:59,510 --> 00:01:02,450 I'm going to create a new empty base plate. 18 00:01:04,260 --> 00:01:08,910 So now we can go ahead and delete both the spawn location and the base plate, because the game assets 19 00:01:08,910 --> 00:01:11,610 that I've attached are going to contain everything you'll need. 20 00:01:11,610 --> 00:01:16,950 So we can go ahead and open up our toolbox and insert the game assets here are mine right here. 21 00:01:16,950 --> 00:01:18,600 We'll drag that into the game. 22 00:01:18,600 --> 00:01:21,660 And now here is everything that we're going to need for our game. 23 00:01:21,660 --> 00:01:24,780 As you can see, we already have a big base plate for the game. 24 00:01:24,780 --> 00:01:28,560 We have some nice city buildings surrounding just for the aesthetic. 25 00:01:29,890 --> 00:01:31,450 As well as an area. 26 00:01:31,450 --> 00:01:37,180 If we go back here in our map, here is an area where we're going to hold all of the dead players in 27 00:01:37,180 --> 00:01:37,600 our game. 28 00:01:37,600 --> 00:01:41,710 As you can see, here is one of the spawn locations for them. 29 00:01:41,710 --> 00:01:45,940 And then the other spawn location for alive players is going to be on our map. 30 00:01:45,940 --> 00:01:47,740 This invisible spawn location. 31 00:01:48,340 --> 00:01:53,260 When players join into our game, they're going to be spawning right here in the middle of our map. 32 00:01:53,590 --> 00:01:58,030 Now, as I stated, you want to have four different areas that zombies can spawn at. 33 00:01:58,030 --> 00:02:03,130 As you can see on our map, one area is going to be right here, another is going to be over here, 34 00:02:03,130 --> 00:02:06,610 one is going to be over here, and the other one is going to be over here. 35 00:02:06,610 --> 00:02:09,640 So I have four different areas that zombies can spawn at. 36 00:02:10,000 --> 00:02:16,480 And inside each of these areas there is an invisible part stored in this folder called zombie spawns. 37 00:02:16,480 --> 00:02:19,300 And these are the different areas that we can spawn our zombies. 38 00:02:19,300 --> 00:02:26,140 And inside each one of these is an attachment which we're going to go ahead and set the zombie keyframe 39 00:02:26,140 --> 00:02:28,990 to when we want to spawn them in the map. 40 00:02:29,660 --> 00:02:36,350 We also have a shop in the middle of our map with an invisible part, and this part has a proximity 41 00:02:36,350 --> 00:02:41,150 prompt inside of it, and this is where players can go up, trigger the prompt, and open up a shop 42 00:02:41,150 --> 00:02:46,880 guy during the intermission between different waves where they can go ahead and buy other equipment. 43 00:02:47,060 --> 00:02:52,700 We also have ammo boxes that players are going to be able to use to refill the ammo in their guns when 44 00:02:52,700 --> 00:02:53,510 they run out. 45 00:02:54,080 --> 00:02:59,960 We also have invisible walls all around the map to prevent zombies and players from being able to climb 46 00:02:59,960 --> 00:03:03,410 out and get outside of the map's boundaries, which we don't want. 47 00:03:03,440 --> 00:03:07,850 So we've added all of these invisible walls to prevent that from happening. 48 00:03:08,120 --> 00:03:14,960 We also want to prevent players from being able to enter into the spawn areas of zombies. 49 00:03:14,960 --> 00:03:18,290 So that's why we have another set of invisible walls. 50 00:03:18,290 --> 00:03:22,730 And each of these invisible walls has a collision group called Zombie Walls. 51 00:03:22,760 --> 00:03:27,410 Now, since we've created a new game, that means the collision groups are not going to be set up for 52 00:03:27,410 --> 00:03:27,560 us. 53 00:03:27,560 --> 00:03:30,350 So we need to go ahead and set up some collision groups. 54 00:03:30,350 --> 00:03:35,480 So if we head over to the model tab and open up collision groups, we're going to want to add three 55 00:03:35,480 --> 00:03:38,930 collision groups, one for zombies, one for players. 56 00:03:38,930 --> 00:03:42,380 And we're going to want to add one for the Zombie Walls collision group. 57 00:03:42,380 --> 00:03:45,830 So we can go ahead and add one for zombie walls. 58 00:03:46,370 --> 00:03:48,710 The other group we need to add is zombie. 59 00:03:48,710 --> 00:03:52,070 And then we also need to add a collision group for players. 60 00:03:52,760 --> 00:03:57,650 Now we want to make sure that zombies are able to walk through these invisible walls, but not players. 61 00:03:57,650 --> 00:04:03,890 So we're going to make sure that zombies cannot collide with anything tagged as zombie walls in their 62 00:04:03,890 --> 00:04:04,670 collision group. 63 00:04:04,700 --> 00:04:10,670 However, we do want players to be able to collide with zombie walls, but we won't want players to 64 00:04:10,670 --> 00:04:14,900 collide with other players, so we're going to uncheck that right there. 65 00:04:15,850 --> 00:04:20,470 In fact, if you take a look at each one of our zombies and we were to select one of their limbs. 66 00:04:21,220 --> 00:04:22,570 If we check their cohesion group. 67 00:04:22,570 --> 00:04:26,050 As you can see, they should automatically be set to zombie for you. 68 00:04:26,050 --> 00:04:29,920 And that way when we go and highlight over the zombie collision group, as you can see, it highlights 69 00:04:29,920 --> 00:04:33,460 each one of those parts showing us the collision group for our zombie. 70 00:04:33,460 --> 00:04:38,140 If we click zombie walls, their highlights, each of the different walls that zombies are going to 71 00:04:38,140 --> 00:04:42,520 be able to walk through, but players are not going to be able to walk through. 72 00:04:43,160 --> 00:04:48,530 So now what we can go ahead and do is that inside of our game assets model, we can go ahead and take 73 00:04:48,530 --> 00:04:51,710 each of these models and ungroup them in their respective service. 74 00:04:51,710 --> 00:04:56,000 So for example this model right here needs to be Ungrouped and replicated storage. 75 00:04:56,000 --> 00:04:57,230 So we'll move that there. 76 00:04:57,230 --> 00:04:59,180 Do control new and ungroup that. 77 00:04:59,790 --> 00:05:01,980 This needs to be Ungrouped in server storage. 78 00:05:01,980 --> 00:05:04,560 So we'll move that over there and group it there. 79 00:05:05,170 --> 00:05:07,150 This one goes to starter Guy. 80 00:05:07,150 --> 00:05:08,320 We'll ungroup that one. 81 00:05:08,980 --> 00:05:11,200 This one goes into teams. 82 00:05:11,200 --> 00:05:14,200 So we'll move that down there and ungroup that. 83 00:05:14,200 --> 00:05:17,080 And then this one needs to be ungrouped in the workspace. 84 00:05:17,080 --> 00:05:21,430 So we'll just make it a child of the workspace controlling U and ungroup that. 85 00:05:21,430 --> 00:05:24,580 And now we no longer need this game assets model. 86 00:05:25,940 --> 00:05:29,060 So on your screen you should see all of this UI stuff. 87 00:05:29,060 --> 00:05:34,280 If you would like to hide that, we can go to the view tab and disable UI visibility for now. 88 00:05:34,280 --> 00:05:39,650 Because one more thing I would like to show you is that inside each of those invisible parts where our 89 00:05:39,650 --> 00:05:45,890 zombies can walk through, each of them have a child inside of them called a pathfinding modifier. 90 00:05:45,890 --> 00:05:52,430 And the purpose of this is to allow our zombies, when we code an AI, for them to be able to see these 91 00:05:52,430 --> 00:05:58,190 parts as non-existent and be able to pathfind through those parts, which why the property inside of 92 00:05:58,190 --> 00:06:00,590 here, called paths through, is set to true. 93 00:06:00,590 --> 00:06:06,680 We have these modifiers inside of these invisible walls, as well as within the different spawn parts. 94 00:06:06,680 --> 00:06:12,950 For our zombies, they also have the same pathfinding modifier, so it's important that these pathfinding 95 00:06:12,950 --> 00:06:19,370 modifiers are children of the different invisible parts that we would like our zombies to walk through. 96 00:06:20,040 --> 00:06:25,560 Now, another thing we want to go ahead and verify is that each of the spawn plates are set to the correct 97 00:06:25,590 --> 00:06:26,250 team. 98 00:06:26,250 --> 00:06:32,040 So if we go ahead and look at our live team and our dead team, as you can see they are set to the sea 99 00:06:32,070 --> 00:06:35,940 green team color and the dusty rose team color respectively. 100 00:06:36,540 --> 00:06:42,330 Make sure that your dead team has auto assignable set to true, and that your live team has auto assignable 101 00:06:42,330 --> 00:06:43,470 set to false. 102 00:06:43,470 --> 00:06:49,140 And then we want to go ahead and check that our live spawn is set to the same color as our live team, 103 00:06:49,140 --> 00:06:50,220 which is sea green. 104 00:06:50,220 --> 00:06:55,320 And then we also want to verify that each of our dead spawns are also set to the dead team color of 105 00:06:55,320 --> 00:06:56,550 dusty Rose. 106 00:06:56,550 --> 00:07:00,300 So if we go and look through, as you can see, they're all set to dusty Rose. 107 00:07:00,880 --> 00:07:03,220 And the alive spawn is set to see green. 108 00:07:03,220 --> 00:07:09,250 And we also want to make sure that each of these spawn plates do not have allow team change on touch 109 00:07:09,250 --> 00:07:11,380 enabled or neutral enabled. 110 00:07:12,100 --> 00:07:14,260 Now if I re-enable UI visibility. 111 00:07:14,260 --> 00:07:18,430 As you can see, I've already created the UI for the game, right? 112 00:07:18,430 --> 00:07:20,440 You already have all of the UI assets. 113 00:07:20,440 --> 00:07:26,290 However, in the next lecture I'm still going to show you how to create this UI and exactly what process 114 00:07:26,290 --> 00:07:29,260 I use for creating UI in my games. 115 00:07:29,830 --> 00:07:35,050 So now that we have everything set up and in the correct places, I'll go ahead and see you in the next 116 00:07:35,050 --> 00:07:35,800 lecture.